/**
 * @Company: 北京慧点科技有限公司 | www.smartdot.com.cn
 * @Copyright 1998-2020 © Smartdot Technologies Co., Ltd.
 */
package com.springlearn.zhoufei.other.spring.demo1;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 描述该类- JPA
 *
 * @author <a href="mailto:zhoufei@smartdot.com.cn">zhoufei</a>
 * @class: Test
 * @date 2020/9/18 20:09
 * @Verson 1.0 -2020/9/18 20:09
 * @see
 */
public class Test4 {
    
    public static String pathHello = "./other\\Bean.xml";
    
    public static void main(String[] args) {
        
        ApplicationContext context = new ClassPathXmlApplicationContext(pathHello);
        System.out.println("---------单例--------------");
        Hello2 hello2 = (Hello2) context.getBean("hello2");
        Hello2 hello21 = (Hello2) context.getBean("hello2");
        hello2.sayHello();
        System.out.println("hello2:" + hello2.hashCode());
        System.out.println("hello21:" + hello21.hashCode());
        
        System.out.println("---------多例--------------");
        Hello3 hello3 = (Hello3) context.getBean("hello3");
        Hello3 hello31 = (Hello3) context.getBean("hello3");
        hello3.sayHello();
        System.out.println("hello3:" + hello3.hashCode());
        System.out.println("hello31:" + hello31.hashCode());
        
    }
}